package br.unicamp.ic.inf312.arena.testeunitario.persistencia.dao;

import java.sql.SQLException;

import br.unicamp.ic.inf312.arena.persistencia.dao.IPagamentoDAO;
import br.unicamp.ic.inf312.framework.persistencia.DataAccessObjectFactory;
import br.unicamp.ic.inf312.framework.teste.DAOBaseTestCase;

public class PagamentoDAOMySQLTest extends DAOBaseTestCase {
	private static final String PERSISTENCIA_PROPERTIES = "br/unicamp/ic/inf312/persistencia.properties";

	private static IPagamentoDAO daoPagto = null;

	protected void setUp() throws Exception {
		super.setUp();
		DataAccessObjectFactory.getInstance(PERSISTENCIA_PROPERTIES);
		daoPagto = (IPagamentoDAO) DataAccessObjectFactory
				.getImpl(IPagamentoDAO.class);
	}

	public void testObterPagamento() {
		try {
			System.out.println("QTD. registros = " + daoPagto.obterCodPagto());
		} catch(SQLException sqlErr) {
			System.err.println(sqlErr.getCause());
			assertFalse(true);
		} catch(Exception err) {
			System.err.println(err.getCause());
			assertFalse(true);
		}
	}

	protected void tearDown() throws Exception {
		super.tearDown();
		daoPagto = null;
	}
}